"""
拦截器处理
"""
from .global_request import *
from .error import *
from App.exception import CustomException


def init_interceptor(app):
    print('init_interceptor')
    app.before_request(global_before_request)
    app.after_request(global_after_request)
    app.teardown_request(global_teardown_request)
    app.register_error_handler(404, not_found_error)
    app.register_error_handler(CustomException, custom_exception)
    app.register_error_handler(Exception, unknown_error)
